<%-- 
    Document   : verificaHilosCurso
    Created on : 06/12/2008, 11:18:36 AM
    Author     : gabriel
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<%@ page import="java.util.*" %>
<%@ page import="connect.HandlerDB" %>
<%

        if (session.getAttribute("user") == null) {
            String error = "usuario nulo";
            session.setAttribute("error", error);
            response.sendRedirect("error.jsp");
            return;
        }

        HandlerDB objCon = new HandlerDB();
        objCon.openConnection();
        String sql = "SELECT * FROM Hilo WHERE curso_id=" + session.getAttribute("curs_id_");
        Vector vr = null;
        session.setAttribute("listaHilos", vr);
        vr = objCon.query(sql);
        if (!vr.isEmpty()) {
            session.setAttribute("listaHilos", vr);
            response.sendRedirect("portalUser.jsp");
        //return;
        }
    /*
    else {
    String error="No existen hilos para este curso "+session.getAttribute("curs_id_");
    session.setAttribute("error",error);
    response.sendRedirect( "error.jsp");
    }
     */
%>
